/*
 * @Description: 
 * @FilePath: /STM32/USER/bsp/delay.h
 * @Author: Wei Zhou
 * @Github: https://github.com/zromyk
 * @Date: 2021-04-28 15:25:19
 * @LastEditors: Wei Zhou
 * @LastEditTime: 2021-04-28 22:03:00
 * @Copyright: Copyright 2017 muyiro. All rights reserved.
 */
#ifndef DELAY_INIT_H
#define DELAY_INIT_H   
           
#include "my_include.h"  

// 硬件延迟宏
#define HARDWARE_DELAY_ENABEL   0

#if HARDWARE_DELAY_ENABEL 

/**
 * @brief  初始化延迟函数
 * @param  SYSCLK: 系统的时钟频率，单位 MHz
 * @retval None
 */
void delay_init(uint8_t SYSCLK);

/**
 * @brief  延时 us
 * @param  us: 0 ~ 204522252 (max 2^32/fac_us @ fac_us=21)
 * @retval None
 */
void delay_us(uint32_t us);

/**
 * @brief  延时 ms
 * @param  ms: 0 ~ 65535
 * @retval None
 */
void delay_ms(uint16_t ms);

#else

/**
 * @brief  延时 us
 * @param  us: 0 ~ 204522252 (max 2^32/fac_us @ fac_us=21)
 * @retval None
 */
void delay_us(uint32_t us);

/**
 * @brief  延时 ms
 * @param  ms: 0 ~ 65535
 * @retval None
 */
void delay_ms(uint32_t ms);

#endif

#endif /* DELAY_INIT_H */
